<?php

namespace app\validate\property\unit;

use think\Validate;

class PropertyUnitValidate extends Validate
{
    protected $rule = [
        'unit_name|单元名称' => 'require',
    ];


    public function sceneAdd()
    {
        return $this->remove('id', 'require');
    }

    public function sceneEdit()
    {
        return $this->remove('name', 'require');
    }

    public function sceneDel()
    {
        return $this->only(['id'])->append('id', 'require|number');
    }
}